//
//  FindDetailCell.m
//  Find
//
//  Created by lanou3g on 15/10/28.
//  Copyright © 2015年 Reiko. All rights reserved.
//

#import "FindDetailCell.h"

@implementation FindDetailCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubviews];
    }
    return self;
}

#pragma mark == 添加视图
- (void)addSubviews{
    self.mineImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, kScreenWidth*0.14, kScreenWidth*0.14)];
    self.mineImageView.backgroundColor = [UIColor orangeColor];
    self.mineImageView.layer.masksToBounds = YES;
    self.mineImageView.layer.cornerRadius = self.mineImageView.frame.size.width/2;
    [self.contentView addSubview:self.mineImageView];
    // 用户名
    self.userNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.mineImageView.frame)+10, CGRectGetMinY(self.mineImageView.frame), kScreenWidth*0.86-30, 21)];
   // self.userNameLabel.backgroundColor = [UIColor grayColor];
    self.userNameLabel.textColor = kFindListCellLabelTextColor;
    self.userNameLabel.font = [UIFont boldSystemFontOfSize:kDetailLabelFont];
    [self.contentView addSubview:self.userNameLabel];
    // 详情
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.userNameLabel.frame)+10, CGRectGetWidth(self.userNameLabel.frame), CGRectGetHeight(self.userNameLabel.frame))];
    self.detailLabel.font = [UIFont systemFontOfSize:kDetailButtonFont];
  //  self.detailLabel.backgroundColor = [UIColor grayColor];
    self.detailLabel.numberOfLines = 0;
    [self.contentView addSubview:self.detailLabel];
    // 时间
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth * 0.75,self.detailLabel.bottom + 5,kScreenWidth * 0.25, 17)];
    self.timeLabel.font = [UIFont systemFontOfSize:kDetailButtonFont];    [self.contentView addSubview:self.timeLabel];
    
    /*
    // 地址图标
    self.addressImageView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.mineImageView.frame), CGRectGetMaxY(self.detailLabel.frame)+10, 17, 17)];
    self.addressImageView.image = [UIImage imageNamed:@"iconfont-address-@3x"];
   // [self.contentView addSubview:self.addressImageView];
    // 地址信息
    self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.addressImageView.frame), CGRectGetMinY(self.addressImageView.frame), 100, 17)];
    self.addressLabel.textColor = kFindListCellLabelTextColor;
    self.addressLabel.font = [UIFont systemFontOfSize:kDetailButtonFont];
    self.addressLabel.backgroundColor = [UIColor grayColor];
   // [self.contentView addSubview:self.addressLabel];
    
    // 评论
    self.commentImageView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.addressLabel.frame)+70, CGRectGetMinY(self.addressLabel.frame), 17, 17)];
    self.commentImageView.image = [UIImage imageNamed:@"iconfont-comment-@3x"];
  //  [self.contentView addSubview:self.commentImageView];
    //
    self.commentButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.commentButton.frame = CGRectMake(CGRectGetMaxX(self.commentImageView.frame), CGRectGetMinY(self.commentImageView.frame), 30, 17);
    [self.commentButton setTitle:@"评论" forState:UIControlStateNormal];
    [self.commentButton setTitleColor:kFindListCellLabelTextColor forState:UIControlStateNormal];
    self.commentButton.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;
    self.commentButton.titleLabel.font = [UIFont systemFontOfSize:kDetailButtonFont];
   // [self.contentView addSubview:self.commentButton];
    
    // 私信
    self.privateLetterImageView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.commentButton.frame)+17, CGRectGetMinY(self.commentButton.frame), 17, 17)];
    self.privateLetterImageView.image = [UIImage imageNamed:@"iconfont-privateLetter-@2x"];
    [self.contentView addSubview:self.privateLetterImageView];
    //
    self.privateLetterButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.privateLetterButton.frame = CGRectMake(CGRectGetMaxX(self.privateLetterImageView.frame), CGRectGetMinY(self.privateLetterImageView.frame), 30, 17);
    self.privateLetterButton.titleLabel.font = [UIFont systemFontOfSize:kDetailButtonFont];
    self.privateLetterButton.contentVerticalAlignment = UIControlContentVerticalAlignmentBottom;
    [self.privateLetterButton setTitle:@"私信" forState:UIControlStateNormal];
    [self.privateLetterButton setTitleColor:kFindListCellLabelTextColor forState:UIControlStateNormal];
    //[self.contentView addSubview:self.privateLetterButton];
    */
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
